//
//  UIButton+Extension.swift
//  KVBestMicroblog
//
//  Created by 李康卫 on 16/7/24.
//  Copyright © 2016年 李康卫. All rights reserved.
//

import UIKit


extension UIButton {
    /* button.setImage(UIImage(named: "timeline_icon_retweet"), forState: UIControlState.Normal)
    button.setTitle("转发", forState: UIControlState.Normal)
    timeline_card_bottom_background_highlighted
    */
    convenience init(imageName: String,title: String,backgroundName: String) {
        self.init()
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        setTitle(title, forState: UIControlState.Normal)
        setTitleColor(UIColor.grayColor(), forState: UIControlState.Normal)
        setBackgroundImage(UIImage(named: backgroundName), forState: UIControlState.Normal)
        setBackgroundImage(UIImage(named: backgroundName + "_highlighted"), forState: UIControlState.Highlighted)
        self.titleLabel?.font = UIFont.systemFontOfSize(10)
        sizeToFit()
    }
}
